#include "BDTestBase.h"
#include "BDSender.h"

IODeviceContext* BDTestBase::m_Context = new IODeviceContext;

void BDTestBase::AllocPainterParamShape(int num)
{
	m_pPainterParam = new PainterRefreshParam;
	for (int i = 0; i < num; ++i) {
		m_pPainterParam->add_shape();
	}
}

void BDTestBase::AllocDetailParamItem(int num)
{
	m_pDetailParam = new DetailRefreshParam;
	for (int i = 0; i < num; ++i) {
		m_pDetailParam->add_item();
	}
}

PainterRefreshParam_Shape* BDTestBase::GetPainterParamShape(int num)
{
	return m_pPainterParam->mutable_shape(num);
}

DetailRefreshParam_Item* BDTestBase::GetDetailParamItem(int num)
{
	return m_pDetailParam->mutable_item(num);
}

void BDTestBase::Notify()
{
	SendMsg(LIB_SENDER, LIB_UI_MSG_PAINTER_REFRESH, m_pPainterParam);
	SendMsg(LIB_SENDER, LIB_UI_MSG_DETAIL_REFRESH, m_pDetailParam);
}